export default {
	/* #ifdef APP-PLUS */
	data(){
		return{
			ezScanCbFunc:()=>{},
			ezScan:{
				main:null,
				receiver:null,
				filter:null,
			}
		}
	},
	onLoad() {
		let _this = this
		this.ezScan.main = plus.android.runtimeMainActivity();
		this.ezScan.receiver = plus.android.implements('io.dcloud.feature.internal.reflect.BroadcastReceiver', {
			onReceive: function(context, intent) {
				plus.android.importClass(intent);
				let code = intent.getStringExtra('data');
				_this.ezScanCbFunc(code)
			}
		});
		var IntentFilter = plus.android.importClass('android.content.IntentFilter');
		this.ezScan.filter = new IntentFilter();
		this.ezScan.filter.addAction("com.huateng.huatengcasting");
	},
	onShow() {
		this.ezScan.main.registerReceiver(this.ezScan.receiver, this.ezScan.filter);
	},
	onHide() {
		this.ezScan.main.unregisterReceiver(this.ezScan.receiver);
	},
	onUnload() {
		this.ezScan.main.unregisterReceiver(this.ezScan.receiver);
	},
	
	/* #endif */
}